<link rel="stylesheet" href="{{url_for('static', filename='font-awesome/css/font-awesome.min.css')}}" media="all">
<link rel="stylesheet" href="{{url_for('static', filename='layui/rc/css/layui.css')}}" media="all">
<link rel="stylesheet" href="{{url_for('static', filename='dist/style/admin.css')}}" media="all">

<div class="layui-form" style="padding: 20px 30px 0 0;">
    <input type="hidden" name="id" value="{{ data['id'] }}">
    <div class="layui-form-item">
        <label class="layui-form-label">设备IP</label>
        <div class="layui-input-inline">
            <input type="text" name="ip" value="{{ data['ip'] }}" placeholder="请输入用户名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">设备标题</label>
        <div class="layui-input-inline">
            <input type="text" name="title" value="{{ data['title'] }}" placeholder="请输入用户名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">指令列表</label>
        <div class="layui-input-inline">
            <input type="text" name="command" value="{{ data['command'] }}" placeholder="请输入用户名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" id="form-submit" value="关闭" class="layui-btn">
        </div>
    </div>
</div>

<script type="application/javascript" src="{{url_for('static', filename='layui/layui.js')}}"></script>
<script>
    layui.use(['jquery', 'element', 'layer'], function(){
        var $ = layui.$; //重点处

        // 确认按钮
        $('#form-submit').on('click', function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index);
        });
    });
</script>